Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
format.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Roc authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_rtp/format.h
10//! @brief RTP payload format.
11
12#ifndef ROC_RTP_FORMAT_H_
13#define ROC_RTP_FORMAT_H_
14
17#include "roc_core/iallocator.h"
18#include "roc_core/time.h"
19#include "roc_packet/rtp.h"
20#include "roc_packet/units.h"
21#include "roc_rtp/headers.h"
22
23namespace roc {
24namespace rtp {
25
26//! RTP payload format.
27struct Format {
28 //! Payload type.
30
31 //! Packet flags.
32 unsigned flags;
33
34 //! Sample rate.
36
37 //! Channel mask.
39
40 //! Get number of samples for given payload size.
41 size_t (*get_num_samples)(size_t payload_size);
42
43 //! Create encoder.
44 audio::IFrameEncoder* (*new_encoder)(core::IAllocator& allocator);
45
46 //! Create decoder.
47 audio::IFrameDecoder* (*new_decoder)(core::IAllocator& allocator);
48};
49
50} // namespace rtp
51} // namespace roc
52
53#endif // ROC_RTP_FORMAT_H_
Audio frame decoder interface.
Audio frame encoder interface.
Memory allocator interface.
Definition: iallocator.h:23
Memory allocator interface.
Audio frame decoder interface.
Audio frame encoder interface.
uint32_t channel_mask_t
Bitmask of channels present in audio packet.
Definition: units.h:77
PayloadType
RTP payload type.
Definition: headers.h:29
Root namespace.
Various units used in packets.
RTP headers.
RTP packet.
RTP payload format.
Definition: format.h:27
packet::channel_mask_t channel_mask
Channel mask.
Definition: format.h:38
PayloadType payload_type
Payload type.
Definition: format.h:29
size_t(* get_num_samples)(size_t payload_size)
Get number of samples for given payload size.
Definition: format.h:41
unsigned flags
Packet flags.
Definition: format.h:32
size_t sample_rate
Sample rate.
Definition: format.h:35
Time definitions.